package com.zzxy.spring3.service.text;
import com.zzxy.spring3.service.impl.StudentServiceimpl;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class Test {
    public static void main(String[] args) throws Exception{
        /*  *//* ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("beans2.xml");
         *//*//*StudentController studentController = (StudentController) context.getBean("studentController");
        studentController.addStudent("zhangsan","123");*//**//*
        StudentController controller = context.getBean(StudentController.class);
        controller.addStudent("zhangsan","123");
*//*
       // IStudentService studentServiceProxy = MyBeanFactoryCglib.creatStudentServiceProxy();
        //studentServiceProxy.deleteStudent(1);
        //StudentServiceImpl studentService = new StudentServiceImpl();
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("beans6.xml");
       StudentServiceimpl stuServiceProxy = (StudentServiceimpl) context.getBean("stuService");
        stuServiceProxy.updateStudent(1);
  //      StudentServiceImpl studentService = context.getBean(StudentServiceImpl.class);
    //    studentService.updateStudent(1);*/
       /* BasicDataSource dataSource = new BasicDataSource();
        dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver");
        dataSource.setUrl("jdbc:mysql:///spring34?serverTimezone=UTC");
        dataSource.setUsername("root");
        dataSource.setPassword("123456");
        JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
        jdbcTemplate.update("insert into t_user values (null,?,?)","zhangsan","123");
        jdbcTemplate.update("update t_user set username = ? where id = ?","lisi",3);*/

    }
}